package design.pattern.策略模式;

/**
 * 满减策略类
 */
public class CashReturn implements CashSuper {

    //需要满足的金额
    private double moneyCondition;

    //满足之后优惠的金额
    private double moneyReturn;

    CashReturn(double moneyCondition, double moneyReturn){
        this.moneyCondition = moneyCondition;
        this.moneyReturn = moneyReturn;
    }
    @Override
    public double acceptCash(double money) {
        if(money >= moneyCondition)
            return money - moneyReturn;
        return money;
    }
}
